function genFloatingMenuBalls(data, pos) {

var FMBCSS = `<style id="FMBCSS">

#FMB, #FMB * {
 display: flex;
 justify-content: center;
 align-items: center;
 text-align: center;
 color: #fff;
 font-family: "思源宋体";
 user-select: none;
}

@media (min-device-width: 393px) {
 #FMB {
  width: 70px;
  height: 70px;
  font-size: 14px;
 }
}

@media (min-device-width: 1680px) {
 #FMB {
  width: 90px;
  height: 90px;
  font-size: 16px;
 }
}

@media (min-device-width: 1920px) {
 #FMB {
  width: 100px;
  height: 100px;
  font-size: 18px;
 }
}

#FMB {
 position: fixed;
 z-index: 9999;
 animation: bounce 5s linear infinite;
}

#FMB:hover {
 animation: none;
}

#FMB .FMB-cover {
 position: absolute;
 z-index: 9998;
 width: 100%;
 height: 100%;
}

#FMB .FMB-cover > div {
 width: 80%;
 height: 80%;
 font-size: 1.4em;
 border-radius: 50%;
 background: radial-gradient(RED 30%, FIREBRICK 150%);
 box-shadow: 0 0 9px SALMON;
 cursor: move;
}

#FMB .FMB-item {
 position: absolute;
 z-index: 9997;
 width: 100%;
 height: 100%;
 transition: transform .5s;
}

#FMB .FMB-item > div {
 width: 78%;
 height: 78%;
 font-size: 1em;
 line-height: 1.2em;
 border-radius: 50%;
 box-shadow: 0 0 5px DARKGRAY;
}

#FMB .FMB-item > div:hover {
 animation: pulse 1s infinite;
}

#FMB .FMB-item > div > a {
 text-decoration: none;
 cursor: pointer;
}

#FMB .FMB-item-1 > div {
 background: linear-gradient(0deg, CORAL 20%, ORANGERED 100%);
}
#FMB .FMB-item-2 > div {
 background: linear-gradient(60deg, GOLD 20%, GOLDENROD 100%);
}
#FMB .FMB-item-3 > div {
 background: linear-gradient(120deg, LIMEGREEN 20%, FORESTGREEN 100%);
}
#FMB .FMB-item-4 > div {
 background: linear-gradient(180deg, TURQUOISE 20%, DARKCYAN 100%);
}
#FMB .FMB-item-5 > div {
 background: linear-gradient(240deg, DEEPSKYBLUE 20%, ROYALBLUE 100%);
}
#FMB .FMB-item-6 > div {
 background: linear-gradient(300deg, VIOLET 20%, PURPLE 100%);
}

#FMB:hover .FMB-item-1 {
 transform: translate3d(0,-90%,0);
}
#FMB:hover .FMB-item-2 {
 transform: translate3d(90%,-45%,0);
}
#FMB:hover .FMB-item-3 {
 transform: translate3d(90%,45%,0);
}
#FMB:hover .FMB-item-4 {
 transform: translate3d(0,90%,0);
}
#FMB:hover .FMB-item-5 {
 transform: translate3d(-90%,45%,0);
}
#FMB:hover .FMB-item-6 {
 transform: translate3d(-90%,-45%,0);
}

@keyframes bounce {
 25% {transform:translateY(15px)}
 50%,100% {transform:translateY(0)}
 75% {transform:translateY(-15px)}
}

@keyframes pulse {
 from {transform:scale3d(1,1,1)}
 50% {transform:scale3d(1.2,1.2,1.2)}
 to {transform:scale3d(1,1,1)}
}

</style>`

document.head.insertAdjacentHTML('beforeend', FMBCSS)

var htmls = []
htmls.push('<div id="FMB">')
htmls.push('<div class="FMB-cover"><div id="FMB-id-0">'+data[0]+'</div></div>')
for (let i=1; i<data.length; i++) {
 if (i > 6) break
 if (data[i] == null) continue
 htmls.push('<div class="FMB-item FMB-item-'+i+'"><div id="FMB-id-'+i+'"><a>'+data[i][0]+'</a></div></div>')
}
htmls.push('</div>')
document.body.insertAdjacentHTML('beforeend', htmls.join(''))

for (let i=1; i<data.length; i++) {
 if (i > 6) break
 if (data[i] == null || data[i][1] == null) continue
 let target = document.getElementById("FMB-id-"+i).firstElementChild
 let action = data[i][1]
 if (typeof action === 'string') {
  if (action.startsWith('!')) {
   target.target = '_self'
   action = action.replace('!', '')
  } else {
   target.target = '_blank'
  }
  target.href = action.replace(/{url}/g, location.href)
 } else if (typeof action === 'function') {
  target.onclick = action
 }
}

var FMB = document.getElementById('FMB')

if (pos == null) { pos = ['80%','90%',null,null] }
FMB.style.top = pos[0]
FMB.style.right = pos[1]
FMB.style.bottom = pos[2]
FMB.style.left = pos[3]

FMB.onmousedown = function(ev) {
 var ev = ev || window.event
 var relaX = ev.clientX - this.offsetLeft
 var relaY = ev.clientY - this.offsetTop
 document.onmousemove = function(ev) {
  var ev = ev || window.event
  FMB.style.left = ev.clientX - relaX + 'px'
  FMB.style.top = ev.clientY - relaY + 'px'
 }
 document.onmouseup = function(ev) {
  var ev = ev || window.event
  document.onmousemove = null
  document.onmouseup = null
 }
}

document.getElementById('FMB-id-0').ondblclick = function() {
 FMB.remove()
 document.getElementById('FMBCSS').remove()
}

}